﻿/**	@file		triangle.hpp
 *	@date		(2007-09-15 13:46:55)/(2007-09-15 13:46:55)
 *-----------------------------------------------------------------------------
 *	@version	1.0.1.1
 *	@author		Nick Shallery	(nicknide@gmail.com)
 *	@copyright	YOU HAVE ALL LEFT WITH THIS CODE WHILE YOU KEEP COMMENT IN EVERY COPY.
 *-----------------------------------------------------------------------------
**/


#if			!defined(__LOLIX__SOLA__TRIANGLE__K_IN_G__)
#define		__LOLIX__SOLA__TRIANGLE__K_IN_G__

#if			!defined(__LOLIX__LOLI_X_CFG__K_IN_G__)
	#include	"../lolix_cfg.h"
#endif	//	!defined(__LOLIX__LOLI_X_CFG__K_IN_G__)

#if			!defined(__LOLIX__SOLA__VEC__NICK__K_IN_G__)
	#include	"./vec.hpp"
#endif		//	!defined(__LOLIX__SOLA__VEC__NICK__K_IN_G__)

namespace lolix{namespace sola{
	template<typename _Ty>
	class triangle
	{
		typedef	triangle<_Ty>	this_type;
	public:
		typedef	_Ty				element_type;
		typedef	vec<3, _Ty>	value_type;

		LOLIX_INLINE_CALL	triangle<_Ty>(void){}
		template<typename _To>
		LOLIX_INLINE_CALL	triangle<_Ty>(const triangle<_To>& o)
		{ v[0] = o.v[0], v[1] = o.v[1], v[2] = o.v[2]; }
		template<typename _Ti>
		LOLIX_INLINE_CALL	triangle<_Ty>(const vec<3, _Ti> (&v3a)[3])
		{ v[0] = v3a[0]; v[1] = v3a[1]; v[2] = v3a[2]; }
		template<typename _T0, typename _T1, typename _T2>
		LOLIX_INLINE_CALL	triangle<_Ty>(const _T0& a, const _T1& b, const _T2& c)
		{ v[0] = a;v[1] = b; v[2] = c; }

		template<typename _To>
		LOLIX_INLINE_CALL	this_type&	operator()(const triangle<_To>& o)
		{ v[0] = o.v[0], v[1] = o.v[1], v[2] = o.v[2]; }
		template<typename _Ti>
		LOLIX_INLINE_CALL	this_type&	operator()(const vec<3, _Ti> (&v3a)[3])
		{ v[0] = v3a[0]; v[1] = v3a[1]; v[2] = v3a[2]; }
		template<typename _T0, typename _T1, typename _T2>
		LOLIX_INLINE_CALL	this_type&	operator()(const _T0& a, const _T1& b, const _T2& c)
		{ v[0] = a;v[1] = b; v[2] = c; }

		value_type	v[3];
	};
}}

#endif	//	!defined(__LOLIX__SOLA__TRIANGLE__K_IN_G__)
